<?php
$this->breadcrumbs=array(
	'Qvobjects'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Qvobjects', 'url'=>array('index')),
	array('label'=>'Create Qvobjects', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('qvobjects-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manage Qvobjects</h1>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<fieldset class="box">
    <legend>QlikView Document ObjectLoader</legend>
    
    <?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'qvobjects-form',
	'enableAjaxValidation'=>false,
)); ?>
	
	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'qvo_docName'); ?>
		<?php echo $form->textField($model,'qvo_docName',array('size'=>60,'maxlength'=>150)); ?>
		<?php echo $form->error($model,'qvo_docName'); ?>
            
            <?php echo CHtml::ajaxButton('Load',
                CHtml::normalizeUrl(array('//qvobjects/loadObjects')),
                array(
                    'type'=>'POST',
                    'success'=>'function(responseText,statusText) {
                                    $.fn.yiiGridView.update(\'qvobjects-grid\');
                                    $("#Notification").jnotifyAddMessage({
                                            text: "Load objects from file...",
                                            permanent: false,
                                            showIcon: true
                                        })
                                }',
                ),
                array('class'=>'ui-button ui-widget ui-state-default ui-corner-all','id'=>'rec_save_button'));
            ?>
            
	</div>    

<?php $this->endWidget(); ?>    

</fieldset>

<?php
$this->widget('ext.ajaxform.JAjaxForm',array(
    'formId'=>'qvobjects-form',
    'options'=>array(
        'dataType'=>'json',
    ),
));
?>


<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'qvobjects-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		//'qvo_id',
		'qvo_objectName',
		'qvo_docName',
		//'qvo_sheetNumber',
                'qvo_reloadCycle',
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
